<template>
    <div>
        <van-nav-bar title="首页" />
        <van-search v-model="value" shape="round" placeholder="请输入搜索关键词" @click="dj"/>
        <van-swipe :autoplay="2000" lazy-render>
            <van-swipe-item v-for="item in swiperdata">
                <img :src="item.image_src" style="width: 100%;height: 200px;" />
            </van-swipe-item>
        </van-swipe>
        <van-grid :column-num="4">
            <van-grid-item v-for="item in catitems" :icon="item.image_src" :text="item.name" />
        </van-grid>
        <div v-for="item in floordata">
            <img :src="item.floor_title.image_src" alt="" style="width: 100%;">
            <div v-for="items in item.product_list">
                <img :src="items.image_src" alt="" style="width: 125px;height: 125px;float: left;">
            </div>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { swiperdataApi, catitemsApi, floordataApi } from '@/api/api'
import router from '@/router';
let swiperdata = ref([])
swiperdataApi().then(res => {
    console.log('轮播', res)
    swiperdata.value = res.data.message
})
let catitems = ref([])
catitemsApi().then(res => {
    console.log('导航', res)
    catitems.value = res.data.message
})
let floordata = ref([])
floordataApi().then(res => {
    console.log('楼层', res)
    floordata.value = res.data.message
})
let dj=()=>{
    router.push('/ss')
}
</script>

<style lang="scss" scoped></style>